<script setup>
import Dialog from "../../../../components/Dialog.vue";

const props = defineProps(["visible", "title", "thead", "data"]);

const emits = defineEmits(["close"]);
</script>

<template>
  <Dialog :visible="props.visible" :title="props.title" @close="emits('close')">
    <div class="box">
      <div class="thead">
        <div
          class="td text-c9-65-14"
          v-for="(item, index) in thead"
          :key="index"
        >
          {{ item }}
        </div>
      </div>
      <div class="tbody">
        <div class="tbody_c" v-for="(item, index) in data" :key="index">
          <div class="td">{{ item.name }}</div>
          <div class="td">{{ item.value }}</div>
        </div>
      </div>
    </div>
  </Dialog>
</template>

<style scoped lang="less">
.box {
  width: 100%;
  height: 100%;
  padding: 20px 60px 26px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  .thead {
    width: 100%;
    display: flex;
    align-items: center;
  }
  .tbody {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;

    overflow: auto;
    .tbody_c {
      width: 100%;
      height: 40px;
      display: flex;
      flex-shrink: 0;
      font-size: 16px;
      color: #ffffff;
      font-family: "Alibaba PuHuiTi 2.0-65 Medium";
      &:nth-child(2n + 1) {
        background: rgba(255, 255, 255, 0.05);
      }
      &:nth-child(2n) {
        background: rgba(255, 255, 255, 0.1);
      }
    }
  }

  .td {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
</style>
